package pers.zhouyoudianxi.notice2;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import pers.zhouyoudianxi.notice2.view.MainFrame;

import javax.swing.*;
import java.awt.*;

@Slf4j
@SpringBootApplication
@EnableScheduling
public class Notice2Application {
    public static void main(String[] args) {
        // 禁用Headless模式，确保Swing正常运行
        System.setProperty("java.awt.headless", "false");

        // 验证是否成功禁用Headless模式
        log.info("Headless模式状态: " + GraphicsEnvironment.isHeadless());

        SpringApplication.run(Notice2Application.class, args);
        log.info("启动成功");
        // 在事件调度线程中启动UI
        SwingUtilities.invokeLater(() -> {
            new MainFrame().setVisible(true);
        });
    }
}
